﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using dados;

namespace web
{
    public partial class Imovel_view : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strCodigo = Request.QueryString["cod"];
                if (!string.IsNullOrEmpty(strCodigo))
                {
                    Imovel objImovel = new Imovel();

                    DataTable dtImovel = objImovel.Pesquisar(long.Parse(strCodigo));

                    imgImovel.ImageUrl = dtImovel.Rows[0]["CaminhoImagem"].ToString();
                    lblNomeImovel.Text = dtImovel.Rows[0]["Descricao"].ToString();
                    lblPreco.Text = dtImovel.Rows[0]["VlUnitario"].ToString();
                    if(dtImovel.Rows[0]["QUANT"].ToString() == "0")
                        lblQuantidade.Text = "Consulte";
                    else
                        lblQuantidade.Text = dtImovel.Rows[0]["QUANT"].ToString();

                    lblTexto.Text = dtImovel.Rows[0]["TEXTO"].ToString();
                }
            }

        }
    }
}
